package com.kaifamiao.www.demo.Do21;

import java.util.Arrays;

public class De08 {
    public static void main(String[] args) {
        int[] arr = new int[]{1,2,3,4,5,6,7,};
        int index = Arrays.binarySearch(arr,2);
        System.out.println(index);
        int[] arr1 = Arrays.copyOfRange(arr,2,4);
        for(int i = 0;i <arr1.length;i++ ){
            System.out.println(arr1[i]);
        }
    }
}
